package com.car.entity;

public class CarSeach {
	
	private String carType;//汽车型号
	private Integer carSupplier;//汽车供应商
	private String price;//汽车售价
	private String driveType;//驱动方式
	private Integer minPrice;//最低售价
	private Integer maxPrice;//最高售价
	
	private Integer start;//从那条数据开始读取
	private Integer size;//一共读取多少条数据
	
	public Integer getStart() {
		return start;
	}
	public void setStart(Integer start) {
		this.start = start;
	}
	public Integer getSize() {
		return size;
	}
	public void setSize(Integer size) {
		this.size = size;
	}
	
	public String getCarType() {
		return carType;
	}
	public void setCarType(String carType) {
		if(carType!=null&&!carType.equals("")){
			this.carType = carType;
		}
	}
	public Integer getCarSupplier() {
		return carSupplier;
	}
	public void setCarSupplier(Integer carSupplier) {
		if(carSupplier!=null&&carSupplier!=0){
			this.carSupplier = carSupplier;
		}
	}
	public String getDriveType() {
		return driveType;
	}
	public void setDriveType(String driveType) {
		if(driveType!=null&&!driveType.equals("")){
			this.driveType = driveType;
		}
	}
	public Integer getMinPrice() {
		return minPrice;
	}
	public Integer getMaxPrice() {
		return maxPrice;
	}
	public void setPrice(String price) {
		
		
		if(price!=null&&!price.equals("")){
			String[] prices = price.split("-");
			Integer price1 = Integer.parseInt(prices[0]);
			Integer price2 = Integer.parseInt(prices[1]);
			if(price1>price2){
				this.maxPrice = price1;
				this.minPrice = price2;
			}else{
				this.maxPrice = price2;
				this.minPrice = price1;
			}
			this.price = price;
		}
	}
	
	public String getPrice(){
		return price;
	}
	

}
